import { TDelegate } from "../../../../../Message/Db/Tables/TDelegate";
import { TSweepUp } from "../../../../../Message/Db/Tables/TSweepUp";
import { EDelegateType } from "../../../../../Message/Game/EDelegateType";
import { CopyConfig } from "../../../resource/CopyConfig";
import { TCopy } from "../../../../../Message/Db/Tables/TCopy";
import { CopyUtil } from "../../copy/CopyUtil";
import { ECopyType } from "../../../../../Message/Public/ECopyType";
type int = number;
//class DelegateTaskData
    
    export  class DelegateTaskData
    {
        constructor(arg1)
        {
            
            if (typeof arg1 === "tdelegate") 
            {
                this.tdelegate = arg1;
            }
            else if (typeof arg1 === "tsweepup") 
            {
                this.tsweepUp = arg1;
            }
            return;
        }

        public set tdelegate(arg1: TDelegate)
        {
            this._tdelegate = arg1;
            this.code = arg1.code;
            if (arg1.type == EDelegateType._EDelegateTypeCopy) 
            {
                this._copy = CopyConfig.instance.getInfoByCode(arg1.code);
            }
            return;
        }

        public get tdelegate(): TDelegate
        {
            return this._tdelegate;
        }

        public set tsweepUp(arg1: TSweepUp)
        {
            this._tsweepUp = arg1;
            this.code = arg1.code;
            this.id = arg1.id;
            this._copy = CopyConfig.instance.getInfoByCode(arg1.code);
            return;
        }

        public get tsweepUp(): TSweepUp
        {
            return this._tsweepUp;
        }

        public get copy(): TCopy
        {
            return this._copy;
        }

        public set copy(arg1: TCopy)
        {
            this._copy = arg1;
            return;
        }

        public isDefenceCopy(): Boolean
        {
            if (this.copy == null) 
            {
                return false;
            }
            return CopyUtil.isDefenceDelegate(this.copy);
        }

        public isHighestDefenceCopy(): Boolean
        {
            if (this.copy == null) 
            {
                return false;
            }
            return CopyUtil.isHighestDefenceCopy(this.copy);
        }

        public isCrossDefenceCopy(): Boolean
        {
            if (this.copy == null) 
            {
                return false;
            }
            return this.copy.copyType == ECopyType._ECopyCrossDefense;
        }

        /* internal */ /* var */_tdelegate: TDelegate;

        /* internal */ /* var */_tsweepUp: TSweepUp;

        public /* var */code: int;

        public /* var */status: int;

        public /* var */id: int;

        /* internal */ /* var */_copy: TCopy;
    }
